package cn.ilikes.tools.untils;

import java.util.List;

import javax.persistence.CascadeType;

import cn.ilikes.tools.hbase.jpa.metadatas.elements.EntityFields;
import cn.ilikes.tools.hbase.jpa.metadatas.elements.EntityFieldsImpl;

public class JPAHBaseUtils {

	public static EntityFields getForeignkeys(Class<?> targetEntity) {
		EntityFields FOREREIGN_ENTITY_FIELDS = new EntityFieldsImpl("foreignKey" + targetEntity.getSimpleName());
		return FOREREIGN_ENTITY_FIELDS;
	}

	public static boolean containsCascade(List<CascadeType> cascades, CascadeType all) {
		for (CascadeType cascadeType : cascades) {
			if (cascadeType.name().equals(all.name()))
				return true;
		}
		return false;
	}

}
